package classes.graphicalEngine
{
	import flash.display.*;
	
	public final class ResourceManager
	{
		[Embed(source="media/brownplane.png")]
		public static var BrownPlane:Class;
		public static var BrownPlaneGraphics:GraphicsResource = new GraphicsResource(new BrownPlane());
		
		[Embed(source="media/smallisland.png")]
		public static var SmallIsland:Class;
		public static var SmallIslandGraphics:GraphicsResource = new GraphicsResource(new SmallIsland());
		
		[Embed(source="media/bigisland.png")]
		public static var BigIsland:Class;
		public static var BigIslandGraphics:GraphicsResource = new GraphicsResource(new BigIsland());
		
		[Embed(source="media/volcanoisland.png")]
		public static var VolcanoIsland:Class;
		public static var VolcanoIslandGraphics:GraphicsResource = new GraphicsResource(new VolcanoIsland());

		[Embed(source="media/cacao1.png")]
		public static var Cacao1:Class;
		public static var Cacao1Graphics:GraphicsResource = new GraphicsResource(new Cacao1());

		[Embed(source="media/cacao2.png")]
		public static var Cacao2:Class;
		public static var Cacao2Graphics:GraphicsResource = new GraphicsResource(new Cacao2());

		[Embed(source="media/champ.png")]
		public static var Champ:Class;
		public static var ChampGraphics:GraphicsResource = new GraphicsResource(new Champ());

		[Embed(source="media/home.png")]
		public static var Home:Class;
		public static var HomeGraphics:GraphicsResource = new GraphicsResource(new Home());

		[Embed(source="media/latex1.png")]
		public static var Latex1:Class;
		public static var Latex1Graphics:GraphicsResource = new GraphicsResource(new Latex1());

		[Embed(source="media/latex2.png")]
		public static var Latex2:Class;
		public static var Latex2Graphics:GraphicsResource = new GraphicsResource(new Latex2());

		[Embed(source="media/manioca.png")]
		public static var Manioca:Class;
		public static var ManiocaGraphics:GraphicsResource = new GraphicsResource(new Manioca());

		[Embed(source="media/soja.png")]
		public static var Soja:Class;
		public static var SojaGraphics:GraphicsResource = new GraphicsResource(new Soja());
/* CHARACTERS */

		[Embed(source="media/extractor.png")]
		public static var Extractor:Class;
		public static var ExtractorGraphics:GraphicsResource = new GraphicsResource(new Extractor());

		[Embed(source="media/fazendeiro.png")]
		public static var Fazendeiro:Class;
		public static var FazendeiroGraphics:GraphicsResource = new GraphicsResource(new Fazendeiro());

		[Embed(source="media/garimpeiro.png")]
		public static var Garimpeiro:Class;
		public static var GarimpeiroGraphics:GraphicsResource = new GraphicsResource(new Garimpeiro());
		
		public static function selectGraphicsResource(name:String):GraphicsResource
		{
			if (name == "Cacao1") return Cacao1Graphics;
			if (name == "Cacao2") return Cacao2Graphics;
			if (name == "Champ") return ChampGraphics;
			if (name == "Home") return HomeGraphics;
			if (name == "Latex1") return Latex1Graphics;
			if (name == "Latex2") return Latex2Graphics;
			if (name == "Manioca") return ManiocaGraphics;
			if (name == "Soja") return SojaGraphics;
			//if (name == "") return Graphics;
			return SojaGraphics;
		}
		
		public static function getGraphicsResourceName(ressource:GraphicsResource):String
		{
			var retour:String = "";
			if (ressource == Cacao1Graphics) retour = "Cacao1";
			if (ressource == Cacao2Graphics) retour = "Cacao2";
			if (ressource == ChampGraphics) retour = "Champ";
			if (ressource == HomeGraphics) retour = "Home";
			if (ressource == Latex1Graphics) retour = "Latex1";
			if (ressource == Latex2Graphics) retour = "Latex2";
			if (ressource == ManiocaGraphics) retour = "Manioca";
			if (ressource == SojaGraphics) retour = "Soja";
			return retour;
		}
		
	}
}